<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
    <title>Hotel Section</title>
</h:head>
<h:body onload="#{ExcursionManaged.allExcursion()};#{ExcursionManaged.handleError()}">
<h:form>
	<p:menubar>  
        <p:submenu label="Package Section" >  
            <p:menuitem value="Create Package" url="packageInsertion.xhtml" />  
            <p:menuitem value="All Packages" url="package.xhtml" />  
        </p:submenu>  
  
        <p:submenu label="Hotel Section" >  
            <p:menuitem value="Add Hotel" url="hotelInsert.xhtml" />  
            <p:menuitem value="All Hotel" url="hotel.xhtml" />  
        </p:submenu>  
        
         <p:submenu label="Transportation Section" >  
            <p:menuitem value="Add Transportation" url="transportationInsert.xhtml" />  
            <p:menuitem value="All Transportation" url="transportationMean.xhtml" />  
        </p:submenu>  
        
         <p:submenu label="Excursion Section" >  
            <p:menuitem value="Add Excursion" url="excursionInsert.xhtml" />  
            <p:menuitem value="All Excursion" url="excursion.xhtml" />  
        </p:submenu>  
  
       <f:facet name="options">   
       		<p:commandButton value="Check OutDated Package" action="#{CheckInvalid.checkAll()}"/>
            <p:commandButton value="Logout" action="#{LoginManaged.logout()}"/>
       </f:facet>
    </p:menubar>  
	<p:dataTable id="dataTable" var="e" value="#{ExcursionManaged.eDTO}" widgetVar="excursionTable" emptyMessage="No excursions found with given criteria" filteredValue="#{ExcursionManaged.filteredExcursion}" >
	<f:facet name="header">  
            <p:outputPanel>  
                <h:outputText value="Search all fields:" />  
                <p:inputText id="globalFilter" onkeyup="excursionTable.filter()" style="width:150px" />  
            </p:outputPanel>  
    </f:facet>  
		<p:column id="nameColumn" filterBy="name" headerText="Name" filterMatchMode="contains" >    
            <h:outputText value="#{e.name}" />  
        </p:column>	
        <p:column id="cityColumn" filterBy="city" headerText="City" filterMatchMode="contains" >    
            <h:outputText value="#{e.city}" />  
        </p:column>	
        <p:column id="typeColumn" filterBy="type" headerText="Type" filterMatchMode="contains" >    
            <h:outputText value="#{e.type}" />  
        </p:column>	
        <p:column>    

            <p:commandButton value="View" action="#{ExcursionManaged.changePage(e.id)}" ajax="false" />
        </p:column>	
        <p:column>    
            <p:commandButton value="Edit" action="#{ExcursionManaged.editPage(e.id)}" ajax="false" />
        </p:column>	
        <p:column>    
            <p:commandButton value ="Delete" action="#{ExcursionManaged.delete(e.id)}" />
        </p:column>	
	</p:dataTable>
	<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
    </h:form>
</h:body>
</html>